<script setup name="ConDept">
import ContractList from "@/views/contract/dept/contractList.vue"
import {tabFunctions} from "@/utils/tab.js";

const {proxy} = getCurrentInstance()
const {conStatus} = proxy.useDict(["conStatus", true])
const activeTabName = ref('')
const contractListRefs = ref([])
const {
  handChangeTab,
  handClickTab,
  loopSetRef
} = tabFunctions(activeTabName, contractListRefs)

</script>

<template>
  <div class="app-container">
    <el-row :gutter="20">
      <!--合同数据-->
      <el-col :span="24" :xs="24">
        <el-tabs v-model="activeTabName" class="demo-tabs" @tab-change="handChangeTab" @tab-click="handClickTab">
          <el-tab-pane v-for="(status, index) in conStatus"
                       :key="status.value"
                       :name="status.value"
                       :label="status.label"
                       lazy
                       style="padding-bottom: 10px;">
            <ContractList :ref="loopSetRef(index)" :status="status.value" :conStatus="conStatus" v-if="activeTabName === status.value"/>
          </el-tab-pane>
        </el-tabs>
      </el-col>
    </el-row>
  </div>
</template>
